window.onload = function() {
    //返回顶部的制作
    var goBack = document.querySelector(".goBack");
    var content = document.querySelector(".content");

    window.addEventListener("scroll", function() {
        if (window.pageYOffset >= content.offsetTop) {
            goBack.style.display = "block";
        } else {
            goBack.style.display = "none";
        }
    })
    goBack.addEventListener("click", function() {
        //当点击返回顶部按钮
        window.scroll(0, 0);
    })
}